Description:
A floating-point operation may produce either a floating-point
infinity or a Not-a-Number (NaN) value. All operations with variables
whose value is NaN, produce NaN. The result of almost all operations
with infinity is infinity. Only if infinity is the second operand
in a division operation will the result be 0.0. FIN detects all
situations which produce a result as
infinity or NaN.
Incorrect:
void ex(double x, double y){
if (x >= 0 && y >= 0) {
if (x <= 0 && y <= 0) {
double z1 = x / y; // NaN is produced
double z2 = 1.0 / x; // positive infinity is produced
}
}
}